<template>
    <div>
        <van-nav-bar fixed="true" title="聊天列表" left-text="返回" left-arrow="" @click-left="onClickLeft" @click-right="onClickRight">
        </van-nav-bar>
        <div style="margin-top: 46px">
            <van-list
                    v-model="loading"
                    :finished="finished"
                    finished-text="没有更多了"
                    @load="onLoad"
            >
                <van-popup v-model="show" closeable="true" position="bottom">
                    <van-cell style="margin-top: 46px"></van-cell>
                    <van-cell style="position: fixed;bottom: 0px">
                        <van-button @click="deleteStatus" type="danger" size="small">删除记录
                        </van-button>
                    </van-cell>
                </van-popup>
                <van-cell is-link @click="showPopup" v-for="item in list" :key="item" :title="item"/>
            </van-list>
        </div>
    </div>
</template>

<script>
    export default {
        name: "statusManager",
        data(){
            return{
                list: [],
                loading: false,
                finished: false,
                show: false,
                show1: false,
                show2: false,



            }
        },
        methods:{
            showPopup() {
                this.show = true;
            },
            onClickLeft(){
                this.$router.push({path:'adminHome'})
            },
            onLoad() {
                this.$axios.post('/status/getChatList',{
                    // 获取所有聊天信息

                },res =>{
                    console.log(res)
                    this.list=res.data.data
                })
                // // 异步更新数据
                // // setTimeout 仅做示例，真实场景中一般为 ajax 请求
                // setTimeout(() => {
                //     for (let i = 0; i < 10; i++) {
                //         this.list.push(this.list.length + 1);
                //     }
                //
                //     // 加载状态结束
                //     this.loading = false;
                //
                //     // 数据全部加载完成
                //     if (this.list.length >= 40) {
                //         this.finished = true;
                //     }
                // }, 1000);
            },
            deleteStatus() {


            },


        },
        mounted(){
            this.onLoad()
        }
    }
</script>

<style scoped>

</style>
